<!Doctype html>
<html>
<head>
	<meta charset="utf-8" />
	<title></title>
	<style>
		#box{width:100px;height:200px;background:#faa;}
	</style>
</head>
<body>
	<input type="text" id="weight" placeholder="体重（kg）">
	<input type="text" id="height" placeholder="身高（m）">
	<div id="box" class="box"></div>
	<input type="button" value="计算BMI" id="btn">
	<script>
		function $ (id) {
			return document.getElementById(id);
		}

		// function GetEleAtt(id,Att){
		// 	var obj = $(id);
		// 	var objAtt = window.getComputedStyle(obj)[Att];
		// 	return objAtt;
		// }

		// function GetEleAttIE(id,Att){
		// 	var o = $(id);
		// 	var oAtt = o.currentStyle;
		// 	return oAtt;
		// }
		function GetElementCss(id){
			var obj = $(id);
			if(window.getComputedStyle){
				var objAtt = window.getComputedStyle(obj);
				return objAtt;
			}
			var oAtt = obj.currentStyle;
			return oAtt;
		}

		function GetElementAtt(id,Att){
			var obj = $(id);
			if(window.getComputedStyle){
				var objAtt = window.getComputedStyle(obj)[Att];
				return objAtt;
			}
			var oAtt = obj.currentStyle;
			return oAtt[Att];
		}
		var a = GetElementAtt('box','width');
		var b = GetElementCss('box');
		

		//obj.style.xxx=''
		//obj.className = '' <div class="">
	</script>
</body>
</html>